<template>
    <div>
        <div v-if="commentListProps && commentListProps.userHendleType">
            <person-center-share-collect-speak
                    ref="shareCollectSpeak"
                    v-if="commentListProps.userHendleType=='module1'"
                    :commentListProps="commentListProps"
                    :rtCommontProps="rtCommont"
                    @getUserMainComment="getUserMainComment"
                    @getSubCommentList="getSubCommentList"
                    @doComment="doComment"
                    @isNotAutoplay="isNotAutoplay"
                    @isLike="isLike"
                    @showShare="showShare"
            ></person-center-share-collect-speak>
            <rt-share-collect-speak
                    ref="shareCollectSpeak"
                    v-if="commentListProps.userHendleType=='module2'"
                    :commentListProps="commentListProps"
                    :rtCommontProps="rtCommont"
                    @getUserMainComment="getUserMainComment"
                    @getSubCommentList="getSubCommentList"
                    @doComment="doComment"
                    @isNotAutoplay="isNotAutoplay"
                    @isLike="isLike"
                    @showShare="showShare"
            >
            </rt-share-collect-speak>
            <share-collect-speak
                    ref="shareCollectSpeak"
                    v-if="commentListProps.userHendleType=='module3'"
                    :commentListProps="commentListProps"
                    :shareCollectSpeak="rtCommont"
                    @getUserMainComment="getUserMainComment"
                    @getSubCommentList="getSubCommentList"
                    @doComment="doComment"
                    @isLike="isLike"
                    @isNotAutoplay="isNotAutoplay"
                    @isShowHomeTap="isShowHomeTap"
                    @showShare="showShare"
            >
            </share-collect-speak>
            <user-info-comment
                    ref="shareCollectSpeak"
                    v-if="commentListProps.userHendleType=='module4'"
                    :commentListProps="commentListProps"
                    :rtCommontProps="rtCommont"
                    @getUserMainComment="getUserMainComment"
                    @getSubCommentList="getSubCommentList"
                    @doComment="doComment"
                    @isLike="isLike"
                    @isNotAutoplay="isNotAutoplay"
                    @showShare="showShare"
            >
            </user-info-comment>
            <!--侧边栏为有定位的点赞评论等等-->
            <right-location-comment
                    ref="shareCollectSpeak"
                    v-if="commentListProps.userHendleType=='module5'"
                    :commentListProps="commentListProps"
                    :rtCommontProps="rtCommont"
                    :discountList="discountList"
                    :goodsDetailProps="goodsDetailProps"
                    @getUserMainComment="getUserMainComment"
                    @getSubCommentList="getSubCommentList"
                    @doComment="doComment"
                    @isLike="isLike"
                    @isNotAutoplay="isNotAutoplay"
                    @isShowHomeTap="isShowHomeTap"
                    @showShare="showShare"
                    @isBigger="isBigger"
                    @toCart="toCart"
            >
            </right-location-comment>
        </div>
    </div>
</template>

<script>
    import {mapMutations} from 'vuex'
    export default {
        name: "UserHandleIcons",
        props: {
            commentListProps: Object,
            rtCommontProps: Object,
            discountList:Array,
            goodsDetailProps:Object,
        },
        data(){
            return {
                rtCommont:{}
            }
        },
        mounted(){
            this.rtCommont = Object.assign({},this.rtCommont,this.rtCommontProps)
        },
        methods: {
            getUserMainComment(obj) {
                this.$emit('getUserMainComment', obj)
            },
            getSubCommentList(obj) {
                this.$emit('getSubCommentList', obj)
            },
            doComment(obj) {
                this.$emit('doComment', obj)
            },
            isLike(obj) {
                console.log(obj,'like')
                this.$emit('isLike', obj);
            },
            isShowHomeTap(boolean){
                this.$emit('isShowHomeTap', boolean)
            },
            isNotAutoplay(boolean){
                this.$emit('isNotAutoplay', boolean)
            },
            nowIndex(index){
                this.rtCommont.nowSwiperIndex = index;
                this.rtCommont = Object.assign({},this.rtCommont)
            },
            isBigger(boolean){
                this.$emit('isBigger', boolean)
            },
            toCart(boolean){
                this.$emit('toCart', boolean)
            },
            showShareFn(boolean){
                if(this.$refs.shareCollectSpeak && this.$refs.shareCollectSpeak.showShareFn){
                    this.$refs.shareCollectSpeak.showShareFn(boolean)
                }
            },
            showShare(boolean){
                this.$emit('showShare',boolean)
            }
        },
        watch:{
            rtCommontProps(val){
                this.rtCommont = Object.assign({},this.rtCommont,val)
            }
        },
        components: {
            'person-center-share-collect-speak': () => import('./PersonCenterShareCollectSpeak'),
            'rt-share-collect-speak': () => import('./RtShareCollectSpeak'),
            'share-collect-speak': () => import('./ShareCollectSpeak'),
            'user-info-comment': () => import('./UserInfoComment'),
            'right-location-comment': () => import('./RightLocationComment'),
        }
    }
</script>

<style scoped>

</style>